"use client";

import * as Sentry from "@sentry/nextjs";
import Error from "next/error";
import { useEffect } from "react";

export default function GlobalError({ error }) {
  useEffect(() => {
    Sentry.captureException(error);
  }, [error]);

  return (
    <div style={{ padding: "20px", textAlign: "center" }}>
      <h2>我们遇到了一些问题</h2>
      <p>页面加载时发生了错误。请尝试刷新页面或稍后再试。</p>
    </div>
  );
}
